import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import path from 'path' 
import { fileURLToPath } from 'url'
export default defineConfig({
    base: '/mars-1/',  // 超算部署打开
    server: {
        host: '0.0.0.0',
        port: 5173,
        strictPort: true,
        hmr: {
            port: 5174
        }
    },
    plugins: [
        vue(),
        AutoImport({ resolvers: [ElementPlusResolver()] }),
        Components({ resolvers: [ElementPlusResolver()] })
    ],
    resolve: {
        alias: {
        '@': path.resolve(__dirname, 'src'), // 添加这行
        '@core': fileURLToPath(new URL('./src/@core', import.meta.url)),
    }
  }
})
